<?php
$conn=mysql_connect("localhost","root","root") or die (mysql_error());
$db=mysql_select_db("datab",$conn) or die (mysql_error());
?>


<!doctype html>
<html lang="en">
  <head>
 
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>registration From</title>
	
    <link rel="stylesheet"  href="css/foundation.css" />
    <script src="js/modernizr.js"></script>
	
	<script src="js/jquery.js"></script>
	<script src="js/foundation/foundation.js"></script>
	<script src="js/foundation/foundation.abide.js"></script>
    <script>
      $(document).foundation();
    </script>
  </head>
  <body id="background">
  <br>
 <center> <img src="image/logo.png" alt=""; width= 400px; /></center>
		</br>							
		
	<div class="row">
		<div class="large-18 right columns">
			<h1><center> Registration Form</center></h1>
			<form  id="border" name="frmmain" method="post" data-abide><div class="medium-13 right panel columns">
			
					<table id="nav" width = 940px; border="0" style="background-color:transparent;">
					<tr>
					<td>
					<label>Last Name</label>
					<input name="lname" type="text" required />
					<small class="error"> Last Name is required.</small>
					</td>
					<td>
					<label >First Name</label>
					<input  name="fname" type="text" required />
					<small class="error">  First Name is required.</small>
					</td>
					<td>
					<label >Middle Name</label>
					<input  name="mname" type="text" required />
					<small class="error"> Middle Name is required.</small>
					</td>
					
					</tr>
					</table>
					<div>
					<label> Sex </label>
					<select id="size1" name="sex">
					<option>choose:</option>
					<option value="Male"> Male</option>
					<option value="Female"> Female</option>
					</select>
					</div>
					
				<div>
					<label>Phone Number</label>
					<input name="phone" type="text" required />
					<small class="error"> Phone Number is required.</small>
				</div>
				<div>
					<label>Email</label>
					<input name="email" type="text" required />
					<small class="error">email is required.</small>
				</div>

					<div>
					<label >Age </label>
					<input name="age" type="text" required />
					<small class="error"> Age is required. </small>
					</div>
					<div>
					<label>Username</label>
					<input name="username" type="text" required />
					<small class="error"> Username is required.</small>
					</div>
					<div>
					<label for="name" >Password</label>
					<input name="password" type="password" required />
					<small class="error"> Password is required.</small>
					</div>
					
			<div>
			<label>upload your resume/bio-data</label>
			<input name="image" type="file" />
			</div>
				<br>
				<center>
					<!-- <button class="small" name="btn">Sign up</button> -->
						<input type="submit" value="Sign up" name="submit">
				</center>
				</br>			
			</div></form>
		</div>
	</div>
	
	
	
    
  </body>
</html>
<?php
if (isset($_POST['submit'])){
echo "call this";
	$lname = $_POST['lname'];
	$fname = $_POST['fname'];
	$mname = $_POST['mname'];
	$sex = $_POST['sex'];
	$phone_number = $_POST['phone'];
	$email = $_POST['email'];
	$age = $_POST['age'];
	$username = $_POST['username'];
	$password = $_POST['password'];
echo $lname;
/*	
	INSERT INTO  `database`.`input` (
`ID` ,
`lname` ,
`fname` ,
`mname` ,
`sex` ,
`phone_number` ,
`email` ,
`age` ,
`username` ,
`password`
)
VALUES (
NULL ,  'fwefqwefa',  'faefqw',  'qwefqwef',  'qefqwef',  '42314',  'qwefqwef',  '1234132',  'sdfwsf',  'afsdfs'
);
*/
	
	
	$sql = "INSERT INTO  user (lname, fname, mname, sex, phone_number, email, age, username, password)
						VALUES('$lname', '$fname', '$mname' , '$sex' , '$phone_number', '$email', '$age' , '$username' , '$password')";
$qry=mysql_query($sql) or die (mysql_error());
	echo $email;
	
}
?>
